@isTest
private class Test_RequestTrigger {

    public static void createData()
    {
    
        //Account Object Record...
        Account accountObject = new Account();
        accountObject.Name = 'Test Account';
        //accountObject.LicenseNumber__c = serialObject.id;
        accountObject.License_Application_Step__c = 'Record Created';
        accountObject.License_Application_Type__c = 'New License';
        accountObject.Activity__c = 'Trading - One Activity';
        accountObject.License_Issue_Date__c = system.today();
        accountObject.License_Expiry_Date__c = System.Today().addYears(1);
        accountObject.Master_Account_Flag__c = true;
        accountObject.Mobile__c = '12321321';
        insert accountObject;
        
         //For Contact Object Records...
        Contact contactObject1 = new Contact();
        contactObject1.LastName = 'Test 1 Manager';
        contactObject1.AccountId = accountObject.id;
        contactObject1.Current_Employer__c =accountObject.id;
        contactObject1.Contact_Type__c = 'Manager';
        insert contactObject1;
        
        
        List<String> requestedForTypes = new List<String>();
        requestedForTypes.add('Banks');
        requestedForTypes.add('Etisalat Services');
        requestedForTypes.add('Purpose of Visit');
        requestedForTypes.add('Embassy');
        requestedForTypes.add('Freereq Zone');
        requestedForTypes.add('Port');
        requestedForTypes.add('Lost Documents');
        requestedForTypes.add('Customs Clarification');
        requestedForTypes.add('Customs Code Number');
        requestedForTypes.add('Emirates');
        requestedForTypes.add('Vehicle Type');
        requestedForTypes.add('Vehicle');
        requestedForTypes.add('Lost Document Address To');
        requestedForTypes.add('Certificate of Origin');
        
        List<Requested_For__c> requestedForList = new List<Requested_For__c>();
        
        for(string requestType : requestedForTypes)
        {
            Requested_For__c newRequestedFor = new Requested_For__c();
            newRequestedFor.isActive__c = True;
            newRequestedFor.Type__c = requestType;
            newRequestedFor.Name = 'Test';
            requestedForList.add(newRequestedFor);
        }
        
        Requested_For__c newRequestedFor = new Requested_For__c();
        newRequestedFor.isActive__c = True;
        newRequestedFor.Type__c = 'Vehicle';
        newRequestedFor.Name = 'Ajman Traffic Department';
        requestedForList.add(newRequestedFor);
        
        newRequestedFor = new Requested_For__c();
        newRequestedFor.isActive__c = True;
        newRequestedFor.Type__c = 'Lost Document Address To';
        newRequestedFor.Name = 'Ajman Police Department';
        requestedForList.add(newRequestedFor);
        
        insert requestedForList;
        
        List<String> countriesNamesList = new List<String>();
        countriesNamesList.add('United Arab Emirates');
        countriesNamesList.add('Egypt');
        
        List<Country__c> countriesList = new List<Country__c>();
        for(String countryName : countriesNamesList)
        {
            Country__c newCountry = new Country__c();
            newCountry.Name = countryName;
            countriesList.add(newCountry);
        }
        insert countriesList;
        
        Transaction_Types__c transactionType = new Transaction_Types__c();
        transactionType.Name = 'Letter - Establishment New';
        //transactionType.Application_Record_Type__c = rt.Name;
        //transactionType.Application_Record_Type_ID__c = recordType15DigitId;
        transactionType.Active__c = true;
        insert transactionType;
        
        List<Request__c> requestList = new List<Request__c>();
        for(Requested_For__c requestFor : requestedForList)
        {
            Request__c requestObject = new Request__c();
            requestObject.Company__c = accountObject.id;
            requestObject.Requested_For__c = requestFor.id;
            requestObject.Transaction_Type__c = transactionType.Id;
            requestObject.PRO_Mobile_No__c = '123213';
            //Adding in the List...
            requestList.add(requestObject);
        }
        
        insert requestList;
        
        ApexPages.currentPage().getParameters().put('Id', requestList[0].Id);
        
        ApexPages.StandardController requestStandardController = new ApexPages.StandardController(requestList[0]);
        ctrl_ServiceLetterPDF serviceLetterExtension = new ctrl_ServiceLetterPDF(requestStandardController);
    }
    
    // Methods for testing
    public static testMethod void testMobileAppEditRequestExtension() {
        
        createData();
        
        //PageReference pageRef = Page.MobileApp_Open_BankLetter_Edit;   
        //Test.setCurrentPage(pageRef);
        
        
        
        //ApexPages.StandardController requestStandardController = new ApexPages.StandardController(newRequest);
        //MobileAppEditRequestExtension editRequestExtension = new MobileAppEditRequestExtension(requestStandardController);
        
   }
}